import { BUTTONID, AREA, UISTATUS, FIELDS, CARDTABLEAREAIDS, DELETELINEBTNS,URL } from '../../constance';
import { ajax ,cardCache, getBusinessInfo, toast} from 'nc-lightapp-front';
export default function(props) { 
    let status = props.getUrlParam('status'); // 页面状态
    if(status ==UISTATUS.browse){

        let value = props.form.getFormItemsValue(AREA.cardHead, 'pk_amortization'); 
        let pk = value.value;


        // let dbilldate = getBusinessInfo().businessDate;
        // let count = props.form.getFormItemsValue(AREA.cardHead, 'count'); 
        // let begin = props.form.getFormItemsValue(AREA.cardHead, 'begin'); 
        // let end = props.form.getFormItemsValue(AREA.cardHead, 'end'); 
        // debugger;
        // if(begin.value==null || end.value==null){
        //     return;
        // }
        // let startdate = new Date(begin.value);
        // if(startdate<new Date(dbilldate) ){
        //     startdate = new Date(dbilldate)
        // }
        
        let request = {
            pk:pk
        };


        ajax({
            url: URL.verfy,
            data: request,
            success: (res) => {
                if(data.errorMessage == undefined){
                    toast({ content: '关闭成功！', color: 'success' });
                }else{
                    toast({content:data.errorMessage,color:'danger'});//错误消息
                }
            }
        });


    }
}
 function dateToString(date){ 
    var year = date.getFullYear(); 
    var month =(date.getMonth() + 1).toString(); 
    var day = (date.getDate()).toString();  
    if (month.length == 1) { 
        month = "0" + month; 
    } 
    if (day.length == 1) { 
        day = "0" + day; 
    }
    var dateTime = year + "-" + month + "-" + day;
    return dateTime; 
  }